/****** Object:  Stored Procedure dbo.spr_UpdateExDBClientsByPK  ******/

 use [TourIS]
 GO

 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spr_UpdateExDBClientsByPK]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
 drop procedure [dbo].[spr_UpdateExDBClientsByPK]
 GO

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS OFF
 GO

 CREATE  PROCEDURE [dbo].[spr_UpdateExDBClientsByPK]
 (
	@address1 varchar(100),
	@address2 varchar(100),
	@orig_clientid int,
	@clientid int,
	@clientname varchar(50),
	@orig_compid int,
	@compid int,
	@contactno varchar(20),
	@emailid varchar(50),
	@expirydate smalldatetime,
	@homecountry varchar(50),
	@isactive bit,
	@nic varchar(15),
	@passportno varchar(20),
	@password varchar(50),
	@reason varchar(200),
	@remarks varchar(200)
 )

 AS

 BEGIN
	SET NOCOUNT ON
	DECLARE @Err int

	UPDATE [Clients]
	SET
		[Address1] = @address1,
		[Address2] = @address2,
		[ClientId] = @clientid,
		[ClientName] = @clientname,
		[CompId] = @compid,
		[ContactNo] = @contactno,
		[EmailId] = @emailid,
		[ExpiryDate] = @expirydate,
		[HomeCountry] = @homecountry,
		[IsActive] = @isactive,
		[NIC] = @nic,
		[PassportNo] = @passportno,
		[Password] = @password,
		[Reason] = @reason,
		[Remarks] = @remarks

	WHERE
	[ClientId] = @orig_clientid
	AND [CompId] = @orig_compid


	SET @Err = @@Error
	RETURN @Err
 END

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS ON
 GO

